#include<stdio.h>
int main()
{
	long long  k=0;
	long long n;
	scanf("%lld",&k);
	n=k;
	int arr[99];
	int t=0;
	if(k>0)
	{
	while(k)
	{
		arr[t++]=n%10;
		k/=10;
	}
}
else if(k<0)
{
		while(k)
	{
		arr[t++]=(-k)%10;
		k/=10;
	}
}
	int count=0;
	for(int i=0;i<t;i++)
	{
		if(arr[i]==2)
		{
			count++;
		}
	}
	if(count==0)
	printf("0%");
	float r=0;
	if(n<0)
	{
		if((-n)%2==0)
		r=count*1.0/t*2*1.5*100;
		else
		r=count*1.0/t*1.5*100; 
	}
	else if(n>0)
	{
		if(n%2==0)
		{
			r=count*1.0/t*2*100;
		}
		else
		r=count*1.0/t*100;
	}
	else
	r=0;
	printf("%.2f%%",r);
}
